home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / Interapplication Communication / AECDEV⁄AEDAEMON / AEDaemon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-09  |  2.4 KB  |  91 lines  |  [TEXT/MPS ]

  1. #include <Types.h>
  2. #include <Memory.h>
  3. #include <Quickdraw.h>
  4. #include <TextEdit.h>
  5. #include <Dialogs.h>
  6. #include <Devices.h>
  7. #include <Scrap.h>
  8. #include <menus.h> 
  9. #include <PPCToolbox.h>
  10. #include <AppleEvents.h>
  11. #include <StandardFile.h>
  12. #include <EPPC.h>
  13. #include <Aliases.h>
  14. #include <events.h>
  15. #include <gestaltequ.h>
  16. #include <ToolUtils.h>
  17.  
  18. /* Types */
  19. struct MyPPCRec {
  20. PPCParamBlockRec    pB;
  21. Ptr        buffer;        /* buffer we're using */
  22. Size bufferSize;    /* guess */
  23. Handle dataToXfer;
  24. PPCPortPtr myPort;
  25. PPCPortPtr buddyPortPtr;
  26. PPCPortRefNum ourPort;
  27. PPCSessRefNum currentSessionRef;
  28.  
  29. };
  30. typedef struct MyPPCRec MyPPCRec, *MyPPCRecPtr,**MyPPCRecHandle;
  31.  
  32.  
  33. typedef struct CDEVRec {
  34. Handle spare;
  35. MyPPCRecPtr myPPCBlock;
  36. /* LocationName won't be needed, since we're staying local */
  37. Boolean searchForTarget;  /* searchForTarget is our flag to tell us that we do not */
  38.                         /* know where AEBuddy is yet, and we have to keep looking. */
  39.                         /*  It also implies (if true) that PBCat has already been */
  40.                         /* called, if necessary */
  41. Boolean noBuddy;        /* PBCatSearch failed, give it up */
  42. Boolean notSys7;
  43. Boolean eventPending;
  44. } CDEVRec, *CDEVPtr, **CDEVHnd;
  45.  
  46.  
  47. struct MyPPCRecDeamon { /* to differentiate it from the one I'm using in the CDEV */
  48. PPCParamBlockRec    pB;
  49. Ptr        buffer;        /* buffer we're using */
  50. Size bufferSize;    /* guess */
  51. Handle dataToXfer;
  52. PPCPortPtr myPort;
  53. PPCPortRefNum ourPort;
  54. PPCSessRefNum currentSessionRef;
  55. };
  56.  
  57. typedef struct MyPPCRecDeamon MyPPCRecDeamon, *MyPPCRecPtrDeamon,**MyPPCRecHandleDeamon;
  58.  
  59.  
  60. #define kOneK 1024
  61. #define kSendButton 1
  62. #define kNoBuddyAlert -4048
  63. #define kNot70 -4049
  64. #define kStringsID -4048
  65. #define kBrowse1 1
  66. #define kBrowse2 2
  67. #define kMyName 3
  68. #define kWatchCursor 4
  69.  
  70. enum  {
  71.   kMyTypeOfData    = 0x4D415654, // 'MAVT'
  72.   kGenericCreator  = 0x3F3F3F3F // '????'
  73. };
  74.  
  75.  
  76. void InitAEStuff(void);
  77. void DoHighLevel(EventRecord *AERecord);
  78. pascal OSErr AEOpenHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  79. pascal OSErr AEOpenDocHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  80. pascal OSErr AEPrintHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  81. pascal OSErr AEQuitHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
  82. Boolean InformTheWorld(void);
  83. OSErr OpenAPort(PPCOpenPBPtr myPort);
  84. Boolean DoInform(PPCInformPBPtr p);
  85. void CloseOffTheWorld(void);
  86. void OpenComplete(PPCInformPBPtr p);
  87. void InformComplete(PPCReadPBPtr p);
  88. void ReadComplete(PPCReadPBPtr p);
  89. void CollectLastData(void);
  90.  
  91.